package Exercise;

import java.util.Scanner;
public class Dengru {
    public static void main(String[] args) {
        String username = "流萤";
        String password = "2024126";
        int count = 1;
        Scanner sc = new Scanner(System.in);
        while(count<=3){
            System.out.println("请输入用户名和密码：");
            String name = sc.next();
            String word = sc.next();
            if(username.equals(name)&&password.equals(word)){
                System.out.println("账号验证成功！");
                break;
            }
            else{
                System.out.println("用户名或密码错误!");
                System.out.println("你还剩下"+(3-count)+"次机会!");
                if((3-count)==0){
                    System.out.println("你的账号已被锁定!");
                }
            }
            count++;
        }
    }
}
